﻿using System.Collections.Generic;
using System.Windows.Controls;
using DALHelper.Business;
using System.Windows;

namespace ResortManager
{
    /// <summary>
    /// Interaction logic for pgTransDetails.xaml
    /// </summary>
    public partial class pgLokupDetails : UserControl
    {
        private bool m_bIsBooking;
        public bool IsBookingRoom
        {
            get { return m_bIsBooking; }
            set
            {
                m_bIsBooking = value;
                dgcolGuestName.IsReadOnly = !m_bIsBooking;
                dgcolGuestID.IsReadOnly = !m_bIsBooking;
                dgcolStartTime.IsReadOnly = !m_bIsBooking;
                dgcolStartTime.Visibility = m_bIsBooking ? Visibility.Visible : Visibility.Hidden;
                dgcolEndTime.IsReadOnly = !m_bIsBooking;
                dgcolEndTime.Visibility = m_bIsBooking ? Visibility.Visible : Visibility.Hidden;

                dgcolCompensation.IsReadOnly = m_bIsBooking;
                dgcolCompensation.Visibility = m_bIsBooking ? Visibility.Hidden : Visibility.Visible;
                
            }
        }

        private IEnumerable<TransDetail> m_transDetailData;
        public IEnumerable<TransDetail> TransDetailData
        {
            get { return m_transDetailData; }
            set
            {
                m_transDetailData = value;
                dgTransDetails.ItemsSource = m_transDetailData;
            }
        }

        public pgLokupDetails()
        {
            InitializeComponent();
        }
    }
}
